import collections
class Solution(object):
    def numJewelsInStones(self, jewels, stones):
        """
        :type jewels: str
        :type stones: str
        :rtype: int
        """
        c1 = set(jewels)
        c2 = collections.Counter(stones)
        t = 0
        for key in c2:
            if key in c1:
                t += c2[key]
        return t
